import 'package:get/get.dart';
import 'package:super_person_app/pages/find/find_binding.dart';
import 'package:super_person_app/pages/find/find_view.dart';
import 'package:super_person_app/pages/frame/frame_binding.dart';
import 'package:super_person_app/pages/frame/frame_view.dart';
import 'package:super_person_app/pages/home/news/news_binding.dart';
import 'package:super_person_app/pages/home/news/news_view.dart';
import 'package:super_person_app/pages/login/login_binding.dart';
import 'package:super_person_app/pages/login/login_view.dart';
import 'package:super_person_app/pages/message/chart/chart_binding.dart';
import 'package:super_person_app/pages/message/chart/chart_view.dart';
import 'package:super_person_app/pages/message/message_binding.dart';
import 'package:super_person_app/pages/message/message_view.dart';
import 'package:super_person_app/pages/my/my_binding.dart';
import 'package:super_person_app/pages/my/my_view.dart';
import 'package:super_person_app/pages/splash/splash_view.dart';
import 'package:super_person_app/pages/app/app_view.dart';
import 'package:super_person_app/pages/app/app_binding.dart';
import 'package:super_person_app/middleware/auth_middleware.dart';

import '../pages/home/home_binding.dart';
import '../pages/home/home_view.dart';
import '../pages/not_found/not_found_view.dart';
import '../pages/splash/splash_binding.dart';
import 'app_routes.dart';

abstract class AppPages {
  static final routes = [
    GetPage(
        name: Routes.app,
        page: () => AppPage(),
        binding: AppBinding(),
        middlewares: [
          AuthMiddleware(),
        ]),
    GetPage(
      name: Routes.frame,
      page: () => const FramePage(),
      binding: FrameBinding(),
      transition: Transition.fadeIn,
    ),
    GetPage(
        name: Routes.message,
        page: () => const MessagePage(),
        binding: MessageBinding(),
        children: [
          GetPage(name: Routes.messageChart, page: () => const ChartPage(), binding: ChartBinding())
        ]
    ),
    GetPage(
        name: Routes.find,
        page: () => const FindPage(),
        binding: FindBinding()),
    GetPage(name: Routes.my, page: () => const MyPage(), binding: MyBinding()),
    GetPage(
      name: Routes.login,
      page: () => LoginPage(),
      binding: LoginBinding(),
      transition: Transition.noTransition,
    ),
    GetPage(
      name: Routes.splash,
      page: () => SplashPage(),
      binding: SplashBinding(),
      transition: Transition.fadeIn,
    ),
    GetPage(
        name: Routes.home,
        page: () => const HomePage(),
        binding: HomeBinding(),
        children: [
          GetPage(name: Routes.homeNews, page: () => const NewsPage(), binding: NewsBinding())
        ]
    ),
  ];
  static final unknownRoute = GetPage(
    name: Routes.notFound,
    page: () => NotFoundPage(),
  );
}
